package net.sf.odinms.net.channel.handler;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.net.channel.handler.AbstractDealDamageHandler.AttackInfo;
import net.sf.odinms.server.MapleStatEffect;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;

/** 
 * 
 * @author Bassoe 
 */
public class PassiveEnergyHandler extends AbstractDealDamageHandler {
    
    @Override
    public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
        //System.out.println("被动反击 封包: "+slea.toString());
        AttackInfo attack = parsePassiveEnergy(c.getPlayer(), slea);
        int maxdamage = c.getPlayer().getCurrentMaxBaseDamage();
        MapleStatEffect effect = attack.getAttackEffect(c.getPlayer());
        if (effect != null) {
            maxdamage *= effect.getDamage() / 100.0;
        }
        applyAttack(attack, c.getPlayer(), maxdamage, 1);
    }
}  